package com.kx.service.impl;

import com.kx.dao.StudentDao;
import com.kx.entity.Student;
import com.kx.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    //引用类型
    private StudentDao studentDao;

    //使用set注入
    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public int addStudent(Student student) {
        int num=studentDao.insertStudent(student);
        System.out.println("=======================添加成功");
        return num;
    }

    @Override
    public List<Student> queryStudents() {
        return studentDao.selectStudents();
    }
}
